}
e = load_bl32(bl2_to_bl31_params);
- if (e)
- WARN("Failed to load BL3-2 (%i)\n", e);
+ if (e) {
+ if (e == LOAD_AUTH_ERR) {
+ ERROR("Failed to authenticate BL3-2\n");
+ panic();
+ } else {
+ WARN("Failed to load BL3-2 (%i)\n", e);
+ }
+ }
e = load_bl33(bl2_to_bl31_params);
if (e) {
#include <errno.h>
#include <io_storage.h>
#include <platform.h>
+#include <string.h>
unsigned long page_align(unsigned long value, unsigned dir)
{
if (rc == 0) {
rc = load_auth_image(mem_layout, parent_id, image_base,
image_data, NULL);
- if (rc != IO_SUCCESS) {
+ if (rc != LOAD_SUCCESS) {
return rc;
}
}
rc = load_image(mem_layout, image_id, image_base, image_data,
entry_point_info);
if (rc != IO_SUCCESS) {
- return rc;
+ return LOAD_ERR;
}
#if TRUSTED_BOARD_BOOT
(void *)image_data->image_base,
image_data->image_size);
if (rc != 0) {
- return IO_FAIL;
+ memset((void *)image_data->image_base, 0x00,
+ image_data->image_size);
+ flush_dcache_range(image_data->image_base,
+ image_data->image_size);
+ return LOAD_AUTH_ERR;
}
/* After working with data, invalidate the data cache */
(size_t)image_data->image_size);
#endif /* TRUSTED_BOARD_BOOT */
- return IO_SUCCESS;
+ return LOAD_SUCCESS;
}
image_info_t *bl33_image_info;
} bl31_params_t;
+/*
+ * load_auth_image() return values
+ */
+enum {
+ LOAD_SUCCESS, /* Load + authentication success */
+ LOAD_ERR, /* Load error */
+ LOAD_AUTH_ERR /* Authentication error */
+};
+
/*
* Compile time assertions related to the 'entry_point_info' structure to